// 为什么要添加类型, 目的是其他页面复用的时候, 会有类型提示
import type { FieldRule } from 'vant'

const phoneRule: FieldRule[] = [
  { required: true, message: '请输入手机号' },
  { pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号' }
]

const passwordRule: FieldRule[] = [
  { required: true, message: '请输入密码' },
  { pattern: /^\w{8,24}$/, message: '请输入8-24位字符' }
]

const codeRule: FieldRule[] = [
  { required: true, message: '请输入验证码' },
  { pattern: /^\d{6}$/, message: '请输入6位验证码' }
]
export { phoneRule, passwordRule, codeRule }
